Skip to content

Conversation

jcassidyav
Copy link
Contributor

@jcassidyav jcassidyav commented Sep 30, 2025

PR Checklist

What is the current behavior?

Users are prevented from using npm install --ignore-scripts because any ns plugin that requires hooks utilises post install events to install the hooks.

What is the new behavior?

This PR provides the hooks command to manage plugin hooks.

PR provides:

Command Description
ns hooks Lists the hooks that are in the installed plugins ( also ns hooks list ).
ns hooks install Installs the hooks.
ns hooks lock Creates a nativescript-lock.json file, this is a list of hooks per plugin and a hash of the script for each hook.
ns hooks verify Compares the hooks in the plugins with what is specified in the nativescript-lock.json file, failing if a hook is not listed or the hash is not the same.

Usages

  • Modify/Create .npmrc in the project root adding ignore-scripts=true
  • After npm i run ns hooks install

For extra peace of mind:

Run ns hooks lock and ns hooks install will fail if any of the hooks have changed.

@NathanWalker NathanWalker changed the title Hooks feat: hooks command Oct 1, 2025
@NathanWalker NathanWalker added this to the 9.0 milestone Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants